<template>
  <van-nav-bar
    fixed
    :title="$route.meta.title"
    style="background-color: #dcdcdc;"
  >
    <!-- 左侧返回按钮 -->
    <template #left>
      <div v-show="$route.path !== '/home'" @click="handleBack">
        <van-icon name="arrow-left" size="14" style="vertical-align: middle" />
        返回
      </div>
    </template>

    <!-- 右侧高笳恺按钮 -->
    <template #right>
      <div
        style="
          color: #007bff;
          padding: 2px 8px;
          font-size: 12px;
          cursor: pointer;
        "
      >周宇
      </div>
    </template>
  </van-nav-bar>
</template>

<script>
export default {
  methods: {
    handleBack() {
      // 触发路由返回操作
      this.$router.back();
    },
  },
};
</script>